<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var grade = prompt('请输入你的分数：');
        //第一层：判断输入的值是数字还是字符？
        if(isNaN(grade)){
            alert('请输入数值！');
        }else{
            //第二层：判断输入的值是否在合法的取值范围？
            if(grade >=0 && grade <= 100) {
                //第三层：判断对应的等级
                if(grade >= 90){
                    document.write('<h2>优秀</h2>');
                }else  if(grade >= 80){
                    document.write('<h2>良好</h2>');
                }else  if(grade >= 70){
                    document.write('<h2>中等</h2>');
                }else  if(grade >= 60){
                    document.write('<h2>及格</h2>');
                }else{
                    document.write('<h2>不及格</h2>');
                }
            }else{
                alert('你输入的数字不在取值范围内！');
            }
        }
    </script>
</body>
</html>